import { Controller, Post, Body } from '@nestjs/common';
import { ApiOperation } from '@nestjs/swagger';
import { WepayService } from './wepay.service';
import { SignDto } from './dto/sign.dto';

@Controller('wepay')
export class WepayController {
  constructor(private readonly wepayService: WepayService) {}

  @Post('sign')
  @ApiOperation({ summary: '获取支付签名' })
  Sign(@Body() signDto: SignDto) {
    return this.wepayService.getSignature(
      signDto.appId,
      signDto.timeStamp,
      signDto.nonceStr,
      signDto.package,
    );
  }
}
